With reference to the above given tables, write commands in SQL for (i) and (ii) and output for (iii) below: -Technology

1 Answer

Answer :

(i) select TName, Passenger from Train T, Reservation R where T.TrainId=R.TrainId;(ii) select T.* from Train T, Reservation R where T.TrainId!=R.TrainId;(iii)TrainIdTNameSourceDestination3424Lucknow MailLucknowNew Delhi5400Century ExpressNew DelhiKanpur

Related questions

Description : Consider the following table Furniture. Write SQL commands for the statements (i) to (viii) and write output for SQL queries (ix) and (x). -Technology

Last Answer : SQL commands for the given statements (i) to (viii) ;1. SELECT FCODE, NAME. PRICE FROM Furniture WHERE PRICE < 5000;2. SELECT NAME. PRICE FROM Furniture3.4. WHERE NAME LIKE %table% ;5. SELECT DISTINCT WCODE ... ;15.16. Output for SQL queries (ix) and (x)(ix)SUM(PRICE)6500(x)COUNT(DISTINCT PRICE)5

Description : Write SQL Query commands based on the following table: -Technology

Last Answer : This answer was deleted by our moderators...

Description : Consider the decimal number x with value 8459.2654. Write commands in SQL to: i. round it off to a whole number -Technology

Last Answer : i. select round(8459.2654);ii.select round(8459.2654,-2);

Description : Consider the following SQL string: “Preoccupied” Write commands to display: (a)“occupied” (b)“cup” -Technology

Last Answer : commands to display:(a)“occupied” (b)“cup”

Description : Considering the same string “Preoccupied” Write SQL commands to display: (a) the position of the substring ‘cup’ in the string “Preoccupied” -Technology

Last Answer : (a)select instr 'Preoccupied' , ‘ 'cup'));(b)select left 'Preoccupied',4);

Description : Consider the following two commands C1 and C2 on the relation R from an SQL database:  C1: drop table R; C2: delete from R; Which of the following statements is TRUE? I. Both C1 and C2 delete the schema for R. II. C2 ... R. (A) I only (B) I and II only (C) II and III only (D) I, II and III

Last Answer : (C) II and III only

Description : Write the output of the following SQL command. select round (49.88); (a)49.88 (b)49.8 (c)49.0 (d)50 -Technology

Last Answer : The correct answer is : (a) 50

Description : In a Bank’s database, there are two tables ‘Customer’ and ‘Transaction’ as shown below. Write a query to display customer’s name who has -Technology

Last Answer : (i) Select cust_name from customer c,transaction t where c.Acc_No=t.Acc_No and Transaction_Type= 'Debit';(ii)Select cust_name, t.* from customer c, transaction t where c.Acc_No=t.Acc_No;(iii) ... total amount of all type of transactions, it will only display the total of credit transactions only.

Description : Consider the tables given below. Salesperson -Technology

Last Answer : (i) Primary, Foreign(ii) Salespersons cannot be set as the primary key in the table Orders because table Orders has already primary key and one table cannot have more than one primary key column.

Description : Write the commands to do the following operations on the dataframes given above : (i) To add dataframes df1 and df2. -Technology

Last Answer : import numpy as npimport pandas as pddf1 = pd.DataFrame({'mark1':[30,40,15,40],'mark2':[20,45,30,70]});df2 = pd.DataFrame({'mark1':[10,20,20,50],'mark2':[15,25,30,30]});print(df1)print(df2)(i) ... , inplace=True) print(df1)(iv) df1.rename(index = {0: 'zero', 1:'one'}, inplace = True) print(df1)

Description : In a Bank’s database, there are two tables ‘Customer’ and ‘Transaction’ as shown below. -Technology

Last Answer : (i)Acc_No, Cust_Phone(ii)All the columns having capability to become Primary Key are known as Candidate Keys.(iii)Acc_No(iv)Trans_Id

Description : Write the output for the following commands: (i) ls –a (ii) date “+%D”

Last Answer : i) ls –a : list all files including hidden files. These are files that start with “.”. ii) date “+%D” : Display date as mm/dd/yy. output: 11/26/19

Description : Read the different components from (i) to (iv) in the list given below and tell the correct order of the components with reference to their arrangement from outer side to inner side in a woody dicot stem. (i) Secondary cortex (ii) Wood ... ) (c) (iii), (iv), (ii), (i) (d) (i), (ii), (iv), (iii).

Last Answer : (a) (iv), (i), (iii), (ii)

Description : Rishi, a class XII student has given following commands for the given purposes: (i) To add a new column “Rating” : -Technology

Last Answer : No, above commands will not be able to achieve desired task as update and alter commands have been interchanged.In order to achieve desired result, following corrections should be incorporated in the previously used ... give an increase of 50 Rs. to all the books:Update library set price=price+50;

Description : Does OpenOffice support all the standard SQL commands?

Last Answer : http://www.google.com/#hl=en&q=openoffice+sql+functions

Description : . Which attack is an HTTP attack which allows attackers to access restricted directories and execute commands outside the web servers root directory? a. XSS attack b. Path Traversal attack c. MITM attack d. SQL Injection attack

Last Answer : d. SQL Injection attack

Description : Write SQL query to create a table “BOOKS” with the following structure: Table: BOOKS -Technology

Last Answer : Create table Books(BOOK_ID Integer (2) Primary Key,BOOK_NAME Varchar (20),CATEGORY Varchar (20),ISSUE_DATE Date);

Description : Write SQL query to create a table “Registration” with the following structure: -Technology

Last Answer : Create table Registration(Reg_Id Integer(2) Primary Key,Name varchar(20),Course varchar(10),Join_Dt date);

Description : Write SQL query to create a table Inventory with the following structure : -Technology

Last Answer : CREATE TABLE Inventory(Material Id Integer Primary Key,Material Varchar (50) NOT NULL,Category Char,DatePurchase Date) :

Description : Write SQL query to create a table Player with the following structure : -Technology

Last Answer : CREATE TABLE Player(};

Description : Write the SQL command that will display the current time and date. -Technology

Last Answer : Select now();

Description : Write the SQL functions which will perform the following operations: (i) To display the name of the month of the current date . -Technology

Last Answer : (i) monthname(date(now()))(ii) trim(“ Panaroma “)(iii) dayname(date(dob))(iv) instr(name, fname)(v) mod(n1,n2)

Description : Identify the columns out of the given three, which should not be present in each of the following tables: -Technology

Last Answer : (i) DateofBirth(ii) Admno(iii) Phonenumber

Description : How many rows and column will be there in the Cartesian product of the above given tables. Also mention the degree and cardinality -Technology

Last Answer : Cartesian Product:Number of Rows: 20Number of Columns: 9Degree: 9Cardinality: 20

Description : Can cursor variables be stored in PL/SQL tables.If yes how. If not why?

Last Answer : No, a cursor variable points a row which cannot be stored in a two- dimensional PL/SQL table.

Description : Identify input/output devices from the clues given below: (a) Transfers typed or handw -Technology

Last Answer : (a) Scanner(b) Barcode reader(c) Optical Mark Recognition (OMR)(d) Magnetic Ink Character Recognition (MIGR)(e) Printer (f) Speaker

Description : Write command for the operations (i) to (iii) based on the spreadsheet below: -Technology

Last Answer : 1. At cell F2, type =D2*E2 and then copy this formula using mouse Fill handle onto range F3: F5.2. At cell G2, type =IF(C2=”Consumable”, F2*0.07, F2*0.11) and then copy this formula using mouse Fill handle onto range G3: G5.3. At cell G6, type =SUM(G2: G5).

Description : What are the commands contained by Create tab? -Technology

Last Answer : The Create tab has various commands such as Table Design, Table Templates, Pivotchart, Form, Report, Macro and Query Wizard.

Description : What is table? Name the basic commands for creating a table. -Technology

Last Answer : Tables are made up of rows and columns. In HTML, tables are used to display tabular data in Web pages.The basic commands for creating tables are as follows:Table tags Row tags Cell tags andCaption tags .

Description : Anjali writes the following commands with respect to a table employee having fields, empno, name, department, commission. -Technology

Last Answer : This is because the column commission contains a NULL value and the aggregate functions do not take into account NULL values. Thus Command1 returns the total number of records in the table whereas Command2 returns the total number of non NULL values in the column commission.

Description : Which of the following statement is not correct with reference to cron daemon in UNIX O.S? (A) The cron daemon is the standard tool for running commands on a predetermined schedule. (B) It starts ... command lines and the times at which they invoked. (D) Crontab for individual users are not stored.

Last Answer : (D) Crontab for individual users are not stored.

Description : Write the full forms of: (i) URL (ii) (iii) (iv) HTML -Technology

Last Answer : Uniform Resource LocatorList ItemTable DataHyper Text Markup Language

Description : Which of the following is true ? I. Implementation of self-join is possible in SQL with table alias. II. Outer-join operation is basic operation in relational algebra. III. Natural join and outer join operations are ... (B) II and III are correct. (C) Only III is correct. (D) Only I is correct.

Last Answer : (D) Only I is correct.

Description : What is the purpose of SQL? -Technology

Last Answer : SQL is structured query language. It is a standard language of all the RDBMS.

Description : Help him in writing SQL query for the following purpose: (i) To count how many female candidates will be attending the training. -Technology

Last Answer : (i)Select count(name) from training where name like ‘Ms.%’;(ii) Select * from training where fee is NULL;(iii) Select city, fee from training where topic = ‘Cyber Security’;(iv) Alter table training add feedback varchar(20);

Description : Ms. Pari, a beginner in SQL is not able to understand the meaning of “Cancelling a Transaction”. Help her in understanding the same. -Technology

Last Answer : Cancelling a transaction means rolls the transaction to the beginning. It aborts any changes made during the transaction and the state of database is returned to what it was before the transaction began to execute.Rollback command is used for the same.

Description : What is the use of COMMIT in sql ? -Technology

Last Answer : Commit is used to save all the DML transactions, and once saved they cannot be rolled back.

Description : What is the purpose of SQL? -Technology

Last Answer : SQL is structured query language. It is a standard language of all the RDBMS.

Description : Name SQL Single Row functions (for each of the following) that 1. returns a number. -Technology

Last Answer : (i) ASCII () function returns a number.(ii) LCASE () function returns lowercase letters .(iii) DAYNAME () function returns names of days.(iv) DAYOFWEEK () function returns weekday number

Description : To select tuples with some salary, Siddharth has written the following erroneous SQL statement : -Technology

Last Answer : The correct code is :SELECT ID, Salary FROM empsalaryWHERE Salary = 56000 ;

Description : The ....... command can be used to makes changes in the rows of a table in SQL. -Technology

Last Answer : The update command can be used to makes changes in the rows of a table in SQL.

Description : Quantitative data refers to (i) Graphs and tables (ii) Any data you present in your report (iii) Statistical analysis (iv) Numerical data that could be useful to answer your research question(s) and to meet your Objectives

Last Answer : (iv) Numerical data that could be useful to answer your research question(s) and to meet your Objectives

Description : Spurious tuples may occur due to i. Bad normalization ii. Theta joins iii. Updating tables from join a) i& ii b) ii & iii c) i& iii d) ii & iii

Last Answer : a) i& ii b) ii & iii

Description : Database is made up of all the following components except (a) tables (b) queries -Technology

Last Answer : (d) A database is made up of tables, queries, and forms.

Description : A database that contains tables linked by common fields is called a (a) Centralized database (b) Flat file database -Technology

Last Answer : (c) Relational database stores data in the form of tables which are linked by common fields.

Description : A report allows you to represent data retrieved from one or more tables so that, it can be analysed and printed if required. -Technology

Last Answer : True When you want to print those records which are fetched from your database then, reports are more useful for this purpose.

Description : In a MS_Access database, which component is not present? (a) Formula Bar (b) Tables -Technology

Last Answer : (a) MS-Access contains various components, i.e. Tables, Queries, Forms, Reports, Macros and Modules.

Description : The different objects supported by MS_Access are tables, queries, ………… and reports. -Technology

Last Answer : The different objects supported by MS-Access are tables, queries, forms, and reports.

Description : Which of the following is used to specify the beginning of a table’s row? (a) -Technology

Last Answer : (b) tag indicates the beginning of a table’s row.