Skip to main content

TCS Xplore 2023 - SQL MCQ question for best practice ( iON Proctored Assessment )

                    Multiple Choice Questions on SQL 




---------------------->>>>   Click Here :Subscribe to click  <<<<<--------------------------


 SQL -- Structured Query Language

Table Create -   create table

  1. CREATE TABLE STUDENTS (  
  2. ID INT                           NOT NULL,  
  3. NAME VARCHAR (20) NOT NULL,  
  4. AGE INT                         NOT NULL,  
  5. ADDRESS CHAR (25),  
  6. PRIMARY KEY (ID)  
  7. );  

Insert Values : 

INSERT INTO Students (ID,NAME,AGE,ADDRESS,SALARY) VALUES (1, 'Ramesh', 32, 'Ahmedabad', 2000.00 );


---------------------->>>>   Click Here :Subscribe to click  <<<<<--------------------------

Q1.   Which of the following is not a valid SQL type?

  1. FLOAT
  2. NUMERIC
  3. DECIMAL
  4. CHARACTER
Ans : Decimal

Q2.  Which of the following is not a DDL command?

  1. TRUNCATE
  2. ALTER
  3. CREATE
  4. UPDATE
Ans : d

Explanation :  DDL commands are used to define the structure of the database, table, schemas, etc . It enables us to perform the operations like CREATE, DROP, ALTER, RENAME, and TRUNCATE schema objects.

An UPDATE command is used for managing the data stored in a database. It is an example of a DML command that also includes the INSERT and DELETE commands.

Q3.  How many Primary keys can have in a table?
  1. Only 1
  2. Only 2
  3. Depends on no of Columns
  4. Depends on DBA
Ans : a

Q4.    What is the difference between a PRIMARY KEY and a UNIQUE KEY?
  1. Primary key can store null value, whereas a unique key cannot store null value.
  2. We can have only one primary key in a table while we can have multiple unique keys
  3. Primary key cannot be a date variable whereas unique key can be
  4. None of these
Ans : b

Q5.  ______ is NOT a type of constraint in SQL language?
  1. FOREIGN KEY
  2. PRIMARY KEY
  3. UNIQUE
  4. ALTERNATE KEY
Ans : d


Q6.   Find the cities name with the condition and temperature from table 'whether' where condition = sunny or cloudy but temperature >= 60.
  1. SELECT city, temperature, condition FROM weather WHERE condition = 'cloudy' AND condition = 'sunny' OR temperature >= 60
  2. SELECT city, temperature, condition FROM weather WHERE condition = 'cloudy' OR condition = 'sunny' OR temperature >= 60
  3. SELECT city, temperature, condition FROM weather WHERE condition = 'sunny' OR condition = 'cloudy' AND temperature >= 60
  4. SELECT city, temperature, condition FROM weather WHERE condition = 'sunny' AND condition = 'cloudy' AND temperature >= 60
Ans : c


---------------------->>>>   Click Here :Subscribe to click  <<<<<--------------------------





Q7.   Which statement is used to get all data from the student table whose name starts            with  p?
  1. SELECT * FROM student WHERE name LIKE '%p%';
  2. SELECT * FROM student WHERE name LIKE 'p%';
  3. SELECT * FROM student WHERE name LIKE '_p%';
  4. SELECT * FROM student WHERE name LIKE '%p';
Ans : b

Q8.    How can you change "Thomas" into "Michel" in the "LastName" column in the Users table?
  1. UPDATE User SET LastName = 'Thomas' INTO LastName = 'Michel'
  2. MODIFY Users SET LastName = 'Michel' WHERE LastName = 'Thomas'
  3. MODIFY Users SET LastName = 'Thomas' INTO LastName = 'Michel'
  4. UPDATE Users SET LastName = 'Michel' WHERE LastName = 'Thomas'
Ans : d

Q9.    What does the following statement in SQL do?
          Drop table Student ;

Ans : Deletes a table called Student 

Q10.     How many operations are considered to be the most basic SQL operations?

Ans :    4 (CRUD)
            create, read, update and delete

Q11.    What is a table joined with itself called?
        
          a.    join                     b.  outer join
          c.   Self join               d.  None of these 

Ans :  Self join

Q12.    Which of the following is also known as a concatenated key?

Ans :    Composite Key 

Q13.  Which of the following is known as the minimal super key?

Ans :   Candidate Key 

Q14.   Which of the following is not a valid aggregate function?
  1. COUNT
  2. COMPUTE
  3. SUM
  4. MAX

Q15.   What does BLOB in SQL stand for?

Ans : Binary Large Object

 ---------------------->>>>   Click Here :Subscribe to click  <<<<<--------------------------

                                          
                                    THANK YOU 










Comments

Popular posts from this blog

Complete Strategy to clear TCS Xplore IPA in One Attempt Now ( 80+ Score )

  So hello Everyone , Here are the all Links from where you can Practice !  All the resources are searched from my best !  1. For KYT and Bizzskill  Link :- tcs Xplore course  2. Unix Operating system Link :-    a.  click here Link 1 b.  click here Link 2 c.  Click here Link 3   3. UI  Link :-  click here 4. SQL and Pl SQL Link : -  Click here Click here click here 5. Java MCQ  Link :-  click here click here click here 6. Java coding :-  Access the playlist on YouTube :-  click here to watch Access the blogs :-  click here All in one link :-   click here

TCS IPA previous year quistion ( 35 marks ) , Quistion , Input , output

 Problem Statement Video Link :    https://youtu.be/XCBvfJAo908 Create a class TravelAgencies with below attributes: regNo – int agencyName – String pakageType – String price – int flightFacility – boolean Write getters, setters for the above attributes . Create constructor which takes parameter in the above sequence. Create class Solution with main method. Implement two static methods – findAgencyWithHighestPackagePrice and agencyDetailsforGivenIdAndType in Solution class. findAgencyWithHighestPackagePrice method: This method will take array of TravelAgencies objects as an input parameter and return the highest package price from the given array of objects. agencyDetailsForGivenldAndType method: This method will take three input parameters -array of TravelAgencies objects, int parameter regNo and String parameter packageType. The method will return the TravelAgencies object based on below conditions. FlightFacility should be available. The input parameters(regNo and packageType) shoul

TCS IPA previous year problems solved [input + output ] in JAVA - (35 marks )

  Problem Statement :  Video Link :   Click Here Create a class AutonomousCar with the below attributes: carld – int brand – String   noOfTestsConducted – int noOfTestsPassed- int environment – String grade – String Write getters, setters for the above attributes . Create constructor which takes parameter in the above sequence except grade. Create class Solution with main method. Implement two static methods – findTestPassedByEnv and updateCarGrade in Solution class. findTestPassedByEnv method: This method will take two input parameters -array of AutonomousCar objects and string parameter environment. The method will return the sum of the noOfTestsPassed attribute from autonomousCar objects for the environment passed as parameter. If no autonomousCar with the given environment is present in the array of AutonomousCar objects, then the method should return 0. updateCarGrade method: This method will take a String parameter brand, along with the array of AutonomousCar objects. The method