{"id":126808,"date":"2023-04-28T10:00:07","date_gmt":"2023-04-28T04:30:07","guid":{"rendered":"https:\/\/www.aplustopper.com\/?p=126808"},"modified":"2023-04-29T09:58:28","modified_gmt":"2023-04-29T04:28:28","slug":"plus-two-computer-application-chapter-wise-previous-questions-chapter-9","status":"publish","type":"post","link":"https:\/\/www.aplustopper.com\/plus-two-computer-application-chapter-wise-previous-questions-chapter-9\/","title":{"rendered":"Plus Two Computer Application Chapter Wise Previous Questions Chapter 9 Structured Query Language"},"content":{"rendered":"
Question 1. Question 2. Question 3. Question 1. Question 2. Question 3. Question 1. a) Write SQL statements to do the following : b) Write SQL statements to do the following Question 2. b) delete<\/strong> This command is used to delete one or all records from a table b) DDL Commands<\/p>\n 1) Create table :-<\/strong> This command is used to create a table. 2) Alter table :-<\/strong> This command is used to change the structure or add a new column to an existing table. 3) Drop table:-<\/strong> This command is used to delete the structure of the table. Question 3. Question 4. Question 1. Kerala Plus Two Computer Application Chapter Wise Previous Questions Chapter 9 Structured Query Language Plus Two Computer Application Structured Query Language 1 Mark Important Questions Question 1. ______ keyword is used in SELECT query to eliminate duplicate values in a column. (MARCH-2016) UNIQUE b) DISTINCT NOT NULL d) PRIMARY Answer: DISTINCT Question 2. ______ clause […]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[42728],"tags":[],"yoast_head":"\n
\n______ keyword is used in SELECT query to eliminate duplicate values in a column. (MARCH-2016)<\/span>
\nUNIQUE
\nb) DISTINCT
\nNOT NULL
\nd) PRIMARY
\nAnswer:
\nDISTINCT<\/p>\n
\n______ clause of SELECT query is used to apply condition to form groups of records. (MAY-2016)<\/span>
\na) orderby
\n(b) groupby
\n(c) having
\n(d) where
\nAnswer:
\n(b) groupby<\/p>\n
\n_______ command in SQL is used to display the structure of a table.(MAY-2017)<\/span>
\na) LIST
\nb) STRUCT
\nc) DESCRIBE
\nd) SHOW
\nAnswer:
\nc) DESCRIBE<\/p>\nPlus Two Computer Application Structured Query Language 2 Marks Important Questions<\/h3>\n
\nHow will you add a new column to an existing table using SQL statement ? (MARCH-2016)<\/span>
\nAnswer:
\nAlter command with add keyword is used to add a new column to an existing table. Avertable <table name> add <column name> <datatype> [<size>] [<constraint>][FIRST\/AFTER<column name>];
\nEg : Avertable ACCOUNTS add Type varchar(10) AFTER Name;<\/p>\n
\nWhat is a view? How can we create a view using SQL statement? (MAY-2016)<\/span>
\nAnswer:
\nA view is a virtual table. That doesnot really exists but is derived from one or more tables. It is used to view a small part of the entire database.
\nCreate view command is used to create a view. Syntax eg:- create view <view name> as select * from <table name> [Where <condition>];
\neg:- create view studentView as select from student;<\/p>\n
\nExplain primary key constraint with an example. (MAY-2017)<\/span>
\nAnswer:
\nPrimary Key:<\/strong> A primary key is one of the Candidate Keys. It is a set of one or more attributes that can uniquely identify tuples in a relation. Rollno, AdmNo, EmpCode etc are the examples of primary key.<\/p>\nPlus Two Computer Application Structured Query Language 3 Marks Important Questions<\/h3>\n
\nAnswer the following questions . (MARCH-2016)<\/span><\/p>\n\n\n
\n Acc. No.<\/strong><\/td>\n Name<\/strong><\/td>\n Branch<\/strong><\/td>\n Amount<\/strong><\/td>\n<\/tr>\n \n 1001<\/td>\n Anil<\/td>\n Trivandrum<\/td>\n 30000<\/td>\n<\/tr>\n \n 1002<\/td>\n Sanjay<\/td>\n Emakulam<\/td>\n 130000<\/td>\n<\/tr>\n \n 1003<\/td>\n Meera<\/td>\n Kottayam<\/td>\n 275000<\/td>\n<\/tr>\n \n 1004<\/td>\n Sneha<\/td>\n Kottayam<\/td>\n 50000<\/td>\n<\/tr>\n \n 1005<\/td>\n Rajan<\/td>\n Thrisuur<\/td>\n 75000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\ni) Display all the details of accounts with amount greater than 50000 in Emakulam branch.
\nii) Display Acc. No., Branch and Amount in the descending order of amount.
\niii) Display the number of accounts in each branch.
\nAnswer:
\ni) Select * from ACCOUNTS where Amount>50000 and Branch = “Emakulam”
\nii) Select Acc.No, Branch, Amount from ACCOUNTS order by Amount desc;
\niii) Select Branch, count (*) from ACCOUNTS group by branch.<\/p>\n
\ni) Add a new record into the table.
\nii) Update the amount of Sanjay to 100000.
\niii) Delete the details of Anil.
\nAnswer:
\ni) Insert into ACCOUNTS values (1006, \u2018Alvis\u2019, \u2018Thrissur\u2019, 50000);
\nii) Update ACCOUNTS set Amount = 100000 where Name = \u2018Sanjay\u2019;
\niii) Delete from ACCOUNTS where Name = \u2018Anil\u2019;<\/p>\n
\na) Explain SQL statements used to insert and delete data from a table. (MAY-2016)<\/span>
\nb) Explain any two DDL commands
\nAnswer:
\na) Insert<\/strong> command is used to insert new records into a table,. The keyword used with insert is into
\nSyntax:<\/strong> Insert into <table name>[column1, Column2,………, column N] values [value1,Value 2,……… value N];
\neg:- Insert into student (Regno, name) Values(101,\u2018Jose\u2019);<\/p>\n
\nSyntax:<\/strong> delete from <table name> [where con-dition];
\neg:- delete from student; -This command deletes all records.<\/p>\n
\nSyntax:<\/strong> create table <table name>
\n(column name> <data type>[<constraint>]
\n[, column name> <data type>,]……… );
\neg:- create table student (Rno int primary key, name varchar(20));<\/p>\n
\nModify, Add are the keywords used.
\nSyntax:<\/strong> Alter table <table name> modify column name><data type>
\n[<size>] [constraint];
\neg:- Alter table student modify name varchar (30);
\nSyntax:<\/strong> Alter table <table name>
\nAdd <new column name> <data type>
\n[<size>] [constraint>] [first j After <column-name>];
\neg:- Alter table student add grade varchar (2);<\/p>\n
\nSyntax:<\/strong> Drop table <table name>;
\neg:- Drop table student;<\/p>\n
\nWrite SQL for (MAY-2017)<\/span>
\na) Create a table student with the data [nafne_char(20), rollno number(3),marks number(3)].
\nb) List name and rollno of all students
\nc) List name and rollno of students having marks>600.
\nAnswer:
\na) create table student(name varchar(20) primary key.rollno int,marks int);
\nb) select name.rollno from student;
\nc) select name.rollno from student where marks>600;<\/p>\n
\nAn employee table contains name, empno, basicpay, desig. (MAY-2017)<\/span>
\nWrite SQL for
\na) Display name, empno and basicpay of all managers,(desig=”manager”)
\nb) Display empno and salary of all employees
\n(salary=basicpay + da)
\n(da=basicpay\u00a0 *\u00a0 1.15)
\nc) Display name and empno of all the employees whose basicpay<10000.
\nAnswer:
\na) select name,empno,basicpay from employee where design=”manager”;
\nb) select empno,basicpay + basicpay * 1.15 from employee;
\nc) select name,empno from employee where basicpay< 10000;<\/p>\nPlus Two Computer Application Structured Query Language\u00a0 5 Marks Important Questions<\/h3>\n
\nThe structure of the table \u2018EMPLOYEE\u2019 is given below. (MARCH-2017)<\/span>
\n
\nWrite SQL statement for the following
\na) Insert a record into the table.
\nb) Update DA with 60% basic pay
\nc) Display the details of employees whose basic pay is greaterthan 20000.
\nd) Rename the table EMPLOYEE to EMPDETAILS
\nAnswer:
\nINSERT INTO EMPLOYEE VALUES
\n(101,’Alvis’,25000,NULL,NULL);
\nb) UPDATE EMPLOYEE SET DA= Basicpay * 6;
\nc) SELECT * FROM EMPLOYEE WHERE Basicpay > 20000;
\nd) ALTER TABLE EMPLOYEE RENAME TO EMPDETAILS;<\/p>\nPlus Two Computer Application Chapter Wise Previous Questions and Answers<\/a><\/h4>\n","protected":false},"excerpt":{"rendered":"