Discussion
Database contains two tables : Employee (id, name, salary, did) and Dept. (did, dname).
Which of the following is an incorrect SQL query ?
Answer: D
The incorrect query is Insert values into employee (1, 'vijay', 100000, 12);.
The SQL syntax is INSERT INTO table VALUES (...): the keyword INTO and the table name come before VALUES. The statement as written puts VALUES first and omits INTO, so it is a syntax error. The correct form is Insert into employee values (1, 'vijay', 100000, 12);.
The others are valid. The natural join matches the two tables on their common column did. The delete uses a subquery with IN. The update raises the salary by 3% for rows where salary exceeds 100000.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development