0% found this document useful (0 votes)
5 views

mysql practice

question

Uploaded by

nikkurathore2908
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

mysql practice

question

Uploaded by

nikkurathore2908
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

a) To display name, fee, gender, joinyear about the applicants, who have joined before 2010.

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.

a. Alternate key b. Primary key c. Candidate key d. Foreign key

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

a. To retrieve a set of statement

b. To add new row of data to a table

c. To change already existing data in table

d. To delete any existing row in table

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. To ensure that values in a column are NULL

b. To ensure that values in a column are unique

c. To define relationship between tables

d. To specify a condition that must be met for data to be valid in a column

Choose the correct choice as:

(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).

(c) Assertion (A) is true and Reason (R) is false.

(d) Assertion (A) is false and Reason (R) is true.

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.

Reason (R): NOT NULL constraint restricts NULL values in a column.

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.

3. To display the total number of CUSTOMERS for each GENDER.

4. To display the CUSTOMER NAME and BALANCE in ascending order of GENDER.

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.

7. To show names of customers with oldest transaction date.


8. To show balance of customers who havemade a credit transaction.

9. to increase the balance by 5% for all customers

10. to add not null cobstarint of the type column of Transaction table.

11. Remove the column gender from the customer table.

12. Remove rows from customer table for customers who have names with I as 4th character.

13. Insert another row of your choice in transaction table.

14. To show gender wise balance of each customer for gender having average balanvce greater than 10000.

You might also like