mysql practice
mysql practice
b) To display the names of applicants, who are playing fee more than 30000.
c) To display names of all applicants in ascending order of their joinyear.
d) To display the year and the total number of applicants joined in each YEAR from the table APPLICANTS.
e) To display the C_ID (i.e. Course ID) and the number of applicants registered in the course from the APPLICANTS table.
f) To display the applicant's name with their respective course's name from the tables APPLICANTS and COURSES.
g) SELECT Name, Joinyear FROM APPLICANTS WHERE GENDER='F' and C_ID ='A02';
h) SELECT MIN (Joinyear) FROM APPLICANTS WHERE Gender='M' ;
i) SELECT AVG (Fee) FROM APPLICANTS WHERE C_ID='A01' OR C_ID='A05';
j) SELECT SUM (Fee), C_ID FROM APPLICANTS GROUP BY C_ID HAVING COUNT(*)=2;
1. A column or set of column in table that refers to the primary key of another table.
14. Which of the following SQL commands is used to view list of all database?
a. select databases
b. show databases
c. view databases
d. project databases
15. Which of the following SQL commands is used to use/select a particular database?
a. use
b. select
c. view
d. project
16. Which SQL command is used to define and maintain physical structure or schema of table
in database like creating, altering and deleting database object such as table and
constraints?
a. DDL
b. DML
c. DCL
d. TCL
24. Which SQL function is used to determine the no. of row or non-null values?
a. min
b. max
c. count
d. sum
29. INSERT command is used in database to perform
212 | P a g e
30. How many candidate key can a relation/table have in relational database
a. One
b. Two
c. Multiple
d. None
38. What is the primary purpose of unique key constraints in a relational databases?
(a) Both Assertion (A) and Reason (R) are the true and Reason (R) is a correct explanation of Assertion (A).
(b) Both Assertion (A) and Reason (R) are the true but Reason (R) is not a correct explanation of Assertion (A).
39. Assertion (A): LIKE operator is used for pattern matching in WHERE clause.
Reason (R): % and _ wildcard is used in LIKE operator for making a pattern.
4. Assertion (A): The primary key is applied on a column of a table.
1. To display all information about the CUSTOMERS whose NAME starts with 'A'.
2. To display the NAME and BALANCE of Female CUSTOMERS (with GENDER as 'F') whose TRANSACTION Date (TDATE) is
in the year 2019.
5. To display CUSTOMER NAME and their respective INTEREST for all CUSTOMERS where INTEREST is calculated as 8% of
BALANCE
6. To show Name , gender and type of transaction from both the tables.
10. to add not null cobstarint of the type column of Transaction table.
12. Remove rows from customer table for customers who have names with I as 4th character.
14. To show gender wise balance of each customer for gender having average balanvce greater than 10000.