SELECT login_id, pawwsord FROM tbluser
2. Index
Properly created Indexes are help to optimize search result. You need to better understanding of the databases before selection of better performing index. Selection of highly utilized filed as index is very important.
CREATE clustered INDEX ind_login_id ON tbluser(login_id)
3. Primary key
Primary key is the most important index of the table. Most important thing of the primary key is selection of short and unique field. This will leads to easy access to data records.
CREATE TABLE tbluser(id INT, name VARCHAR(150), email VARCHAR(100), login_id VARCHAR(100), password VARCHAR(10), primary_key(id) )
CREATE INDEX ind_email ON tbluser(email)
5. Select limited records
None of the user interfaces can visualize thousand of record at ones. Hence no means of having selected all the record at once, so always limit the selection when you have large number of record set. Select required data only.
SELECT id, name, email, login_id,password FROM tbluser WHERE 1 limite 10
6. Selection of correct data type and length
Use most appropriate data type and correct length of the data. Bad selection data type will produce bulky databases and poor performance. This will improve resource utilization of the database server.
CREATE TABLE tbluser(id INT, name VARCHAR(150), email VARCHAR(100), login_id VARCHAR(100), password VARCHAR(10) )
SELECT login_id,name, email FROM tbluser WHERE login_id IN ( SELECT login_id FROM tbllogin_details)
SELECT login_id,name, email FROM tbluser INNER JOIN tbllogin_details ON tbluser.login_id = tbllogin_details.login_id
8. Avoid NOT operator
Please avoid the usage of NOT operator situation that numbers of qualifying records are lower than unqualified records. Always used positive operator such as LIKE, EXIST than NOT LIKE, NOT EXIST.
SELECT * FROM tbluser WHERE email NOT LIKE '%gmail%'
The other way is
SELECT * FROM tbluser WHERE email LIKE '%yahoo%'
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.