Question On DBMS Quiz-1

Question 1

Time: 00:00:00
What is the output of the following query on the table mint?

Select Id from mint order by id desc, name limit 3,1.



























Name ID
Alfred 20
Don 34
John 23
Fred 21
Glen 43

Alfred

Alfred

Don

Don

John

John

Fred

Fred

Glen

Glen

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
The class time, whose private attributes are the hour, minutes, second wants to display the time in the universal time format(HH,MM,SS) and standard time format (H:MM:SS AM or PM). Consider the class definition below.

Public class Time

{ Private: Int hour, minute, second;

Public:

Time(int hh, int mm, int ss){hour = hh; minute = mm; second = ss;}

String ToDisplayTimeStandard ()

{

hour = ( hour == 0 | | hour == 12) ? 12 ; hour % 12 ;

string s1= hour <12 ? "AM" : "PM" ;

string s2= hour+minute+second+s1;

Display s2;

}

String ToDisplayTimeUniversal ()

{  string s2 =  hour+minute+second ; Display s2; }

}

Void main()

{ Time tobj (6,25,10);

tobj. ToDisplayTimeStandard()

}

 

Overloading

Overloading

Abstraction

Abstraction

Overriding

Overriding

Inheritance

Inheritance

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
Write a SQL query to create a user "user1" in "localhost" with the default password set to "Pass123"?

 

CREATE USER \'user1\'@\'localhost\' IDENTIFIED BY \'Pass123\';

CREATE USER \'user1\'@\'localhost\' IDENTIFIED BY \'Pass123\';

CREATE \'user1\'@\'localhost\' IDENTIFIED BY \'Pass123\';

CREATE \'user1\'@\'localhost\' IDENTIFIED BY \'Pass123\';

CREATE USER \'user1\'@\'localhost\' PASS BY \'Pass123\';

CREATE USER \'user1\'@\'localhost\' PASS BY \'Pass123\';

CREATE USER \'user1\'@\'localhost\' PASSWORD BY \'Pass123\';

CREATE USER \'user1\'@\'localhost\' PASSWORD BY \'Pass123\';

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
What is the language that enables to access and operates on the data in the database?

Data Manipulation Language

Data Manipulation Language

Data access language

Data access language

Data control language

Data control language

Data Definition Language

Data Definition Language

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
Product and Manufacture table are related as 1 to many relationships, to acquire this relation which table should contain the foreign key.

Product Table

Product Table

Manufacturer Table

Manufacturer Table

Both the Table

Both the Table

None of the above

None of the above

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
What is the SQL query to get the list of all the tables in a database?

SHOW TABLES;

SHOW TABLES;

SELECT * FROM DATABASE;

SELECT * FROM DATABASE;

SHOW TABLES FROM DATABASE;

SHOW TABLES FROM DATABASE;

LIST TABLES;

LIST TABLES;

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
Which of the following is the correct SQL to get the second highest "Sal" from the below table?

































EID NAME Sal
1 Mark 12000
2 Rick 11200
3 Eden 21100
4 Rose 21300
5 Maria 14000

 

select max(Sal) from EmpDet limit 2

select max(Sal) from EmpDet limit 2

select min(Sal) from EmpDet where Sal in (select distance top 2 Sal from EmpDet order by Sal desc)

select min(Sal) from EmpDet where Sal in (select distance top 2 Sal from EmpDet order by Sal desc)

select Sal from EmpDet where Sal in (select distinct top 2 Sal from EmpDet order by Sal desc)

select Sal from EmpDet where Sal in (select distinct top 2 Sal from EmpDet order by Sal desc)

select min(Sal) from EmpDet where Sal in (select distance top 2 Sal from EmpDet order by Sal desc)

select min(Sal) from EmpDet where Sal in (select distance top 2 Sal from EmpDet order by Sal desc)

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
What is the SQL statement used to change the autoincrement sequence to start with 10400 for existing table named "Persons"?

ALTER TABLE Persons AUTO_INCREMENT value = 10400

ALTER TABLE Persons AUTO_INCREMENT value = 10400

ALTER TABLE Persons AUTO_INCREMENT 10400

ALTER TABLE Persons AUTO_INCREMENT 10400

ALTER TABLE Persons AUTO_INCREMENT= 10400

ALTER TABLE Persons AUTO_INCREMENT= 10400

ALTER TABLE Persons AUTO_INCREMENT by 10400

ALTER TABLE Persons AUTO_INCREMENT by 10400

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
Consider that we have a table Temp with columns as below:

Temp(C1, C2, C3)

Following are the conditions on the columns:

i.Any of the three columns can have duplicate values

ii. Any of the three columns can have NULL values

iii. The table, however, cannot have a row with all 3 columns as NULL

 

As per the above conditions and the Guaranteed Access rule, how many columns are required to filter a specific row in the table?

 

0

0

1

1

2

2

None of the columns of table Temp can serve as primary key, hence not possible

None of the columns of table Temp can serve as primary key, hence not possible

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
The internal model adapts a ______ model to specific DBMS.

 

Conceptual

Conceptual

Networking

Networking

Entity

Entity

Hierarchical

Hierarchical

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice! \n","Keep trying! \n","Not bad! \n","Good work! \n","Perfect! \n"]

Completed

0/0

Accuracy

0%

Get Prepinsta Prime

Get all 200+ courses offered by Prepinsta

Never Miss an OffCampus Update

Get OffCampus Updates on Social Media from PrepInsta

Follow us on our Media Handles, we post out OffCampus drives on our Instagram, Telegram, Discord, Whatsdapp etc.

Get Hiring Updates
Amazon,Google,Delottie & 30+companies are hiring ! Get hiring Updates right in your inbox from PrepInsta

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Get PrepInsta Prime Subscription

Get access to all the courses that PrepInsta offers, check the out below -

Companies

TCS, Cognizant, Delloite, Infosys, Wipro, CoCubes, KPMG, Amazone, ZS Associates, Accenture, Congnizant & other 50+ companies

Programming

Data Structures, Top 500 Codes, C, C++, Java Python & other 10+ subjects

Skills

Full Stack Web Development, Data Science, Machine Learning, AWS Cloud, & other 10+ skills and 20+ projects

Comments