1. A .... is a stored program that is attached to a table or a view.
2. With SQL, how can you insert a new record into the 'Persons' table?
3. With SQL, how do you select a column named 'FirstName' from a table named 'Persons'?
4. With SQL, how do you select all the records from a table named 'Persons' where the value of the column 'FirstName' is 'Peter'?
5. With SQL, how can you insert 'Olsen' as the 'LastName' in the 'Persons' table?
6. With SQL, how can you return all the records from a table named 'Persons' sorted descending by 'FirstName'?
7. How would you write a query to select all teams that won either 2, 4, 6 or 8 games?
8. Which can add a row to a table?
9. I would like to retrieve the date with this format : dd/mm/YYYY in a field called btimestamp. Choose the correct way.
10. Which is not a valid name for a column
11. TCL stands for ?
12. Which statement about MySQL optimization is True?
13. The USE keyword is used to select a _____.
14. which is not engine of msyql
15. A table may be joined to itself.
16. What is the BDB Configuration for RAM dedicated to holding rows and indexes?
17. Which table declarations creates column 'name' to hold a fixed-length string?
18. Why would you turn on delay_key_write?
19. What does this statement: DELETE FROM xpto WHERE 1;
20. How would you remove all rows from a table 'STAFF'
21. What is true about the ENUM data type?
22. How will you change 'Hansen' into 'Nilsen' in the LastName column in the Persons Table?
23. Evaluate the following SQL statement: SELECT e.employee_id, (.15* e.salary) + (.5 * e.commission_pct) + (s.sales_amount * (.35 * e.bonus)) AS CALC_VALUE FROM employees e, sales s WHERE e.employee_id = s.emp_id; What will happen if all the parentheses are removed from the calculation?
24. Examine the description of the STUDENTS table: STD_ID INT COURSE_ID VARCHAR (10) START_DATE DATE END_DATE DATE The aggregate functions valid on the START_DATE column are:
25. Consider the following tables: Books ------ BookId BookName AuthorId SubjectId PopularityRating (the popularity of the book on a scale of 1 to 10) Language (such as French, English, German etc) Subjects --------- SubjectId Subject (such as History, Geography, Mathematics etc) Authors -------- AuthorId AuthorName Country Which query will determine how many books have a popularity rating of more than 7 on each subject?
26. Which is NOT a valid string type available for column?
27. What will be the result of the following query? SELECT 11 DIV 2:
28. Which choice is NOT a statement you would use to filter data?
29. You are working with very large tables in your database. Which SQL clause do you use to prevent exceedingly large query results?
30. In data migration, there is often a need to delete duplicate rows as part of data cleanup. Which statement works best?
31. Which statement is true about TIMESTAMP and DATETIME data types?
32. When a new student is added to a new database, you want new records to be created in the related tables such as Exam, Score and Attendance. How would you accomplish this?
MySQL MCQs | Topic-wise