English

Arts (English Medium) Class 12 - CBSE Question Bank Solutions for Computer Science (Python)

Advertisements
[object Object]
[object Object]
Subjects
Popular subjects
Topics
Advertisements
Advertisements
Computer Science (Python)
< prev  61 to 80 of 219  next > 

Write a program that takes as input a list of 10 integers and a key value and applies binary search to find whether the key is present in the list or not. If the key is present it should display the position of the key in the list otherwise it should print an appropriate message. Run the program for at least 3 different key values and note the results.

[6] Searching
Chapter: [6] Searching
Concept: undefined >> undefined

Estimate the number of key comparisons required in binary search and linear search if we need to find the details of a person in a sorted database having 230 (1,073, 741, 824) records when details of the person being searched lie at the middle position in the database. What do you interpret from your findings?

[6] Searching
Chapter: [6] Searching
Concept: undefined >> undefined

Advertisements

Differentiate between the following statement:

ALTER and UPDATE

[9] Structured Query Language (SQL)
Chapter: [9] Structured Query Language (SQL)
Concept: undefined >> undefined

A shop called Wonderful Garments which sells school uniforms maintains a database SCHOOLUNIFORM as shown below. It consisted of two relations - UNIFORM and COST. They made UniformCode the primary key for UNIFORM relations. Further, they used UniformCode and Size to be composite keys for COSTrelation. By analyzing the database schema and database state, specify SQL queries to rectify the following anomalies.

  1. M/S Wonderful Garments also keeps handkerchiefs of red colour, medium size of Rs. 100 each.
  2. INSERT INTO COST (UCode, Size, Price) values (7, 'M', 100);
    When the above query is used to insert data, the values for the handkerchief without entering its details in the UNIFORM relation are entered. Make a provision so that the data can be entered in the COST table only if it is already there in the UNIFORM table.
  3. Further, they should be able to assign a new UCode to an item only if it has a valid UName. Write a query to add appropriate constraints to the SCHOOLUNIFORM database.
  4. Add the constraint so that the price of an item is always greater than zero.
[9] Structured Query Language (SQL)
Chapter: [9] Structured Query Language (SQL)
Concept: undefined >> undefined

Suppose your school management has decided to conduct cricket matches between students of Class XI and Class XII. Students of each class are asked to join any one of the four teams – Team Titan, Team Rockers, Team Magnet, and Team Hurricane. During summer vacations, various matches will be conducted between these teams. Help your sports teacher to do the following:

  1. Create a database “Sports”.
  2. Create a table “TEAM” with the following considerations:
    i) It should have a column TeamID for storing an integer value between 1 to 9, which refers to the unique identification of a team.
    ii) Each TeamID should have its associated name (TeamName), which should be a string of length not less than 10 characters.
  3. Using table level constraint, make TeamID the primary key.
  4. Show the structure of the table TEAM using a SQL statement.
  5. As per the preferences of the students four teams were formed as given below. Insert these four rows in the TEAM table:
    Row 1: (1, Team Titan)
    Row 2: (2, Team Rockers)
    Row 3: (3, Team Magnet)
    Row 3: (4, Team Hurricane)
  6. Show the contents of the table TEAM using a DML statement.
  7. Now create another table MATCH_DETAILS and insert data as shown below. Choose appropriate data types and constraints for each attribute.
Table: MATCH_DETAILS
MatchID MatchDate FirstTeamID SecondTeamID FirstTeamScore SecondTeamScore
M1 2018-07-17 1 2 90 86
M2 2018-07-18 3 4 45 48
M3 2018-07-19 1 3 78 56
M4 2018-07-19 2 4 56 67
M5 2018-07-18 1 4 32 87
M6 2018-07-17 2 3 67 51
[9] Structured Query Language (SQL)
Chapter: [9] Structured Query Language (SQL)
Concept: undefined >> undefined

Using the CARSHOWROOM database given in the chapter, write the SQL queries for the following:

  1. Add a new column Discount in the INVENTORY table.
  2. Set appropriate discount values for all cars keeping in mind the following:
    (i) No discount is available on the LXI model.
    (ii) VXI model gives a 10 percent discount.
    (iii) A 12 percent discount is given on cars other than the LXI model and VXI model.
  3. Display the name of the costliest car with the fuel type “Petrol”.
  4. Calculate the average discount and total discount available on Baleno cars.
  5. List the total number of cars having no discount.
[9] Structured Query Language (SQL)
Chapter: [9] Structured Query Language (SQL)
Concept: undefined >> undefined

Among LAN, MAN, and WAN, which has the highest speed, and which one can cover the largest area?

[11] Data Communication
Chapter: [11] Data Communication
Concept: undefined >> undefined

18 Gbps is equal to how many Bits per second?

[11] Data Communication
Chapter: [11] Data Communication
Concept: undefined >> undefined

Write a short note on the following:

Bandwidth

[11] Data Communication
Chapter: [11] Data Communication
Concept: undefined >> undefined

Write a short note on the following:

Data transfer rate

[11] Data Communication
Chapter: [11] Data Communication
Concept: undefined >> undefined

A composite signal contains frequencies between 500 MHz and 1GHz. What is the bandwidth of a signal?

[11] Data Communication
Chapter: [11] Data Communication
Concept: undefined >> undefined

Write a short note on different methods of malware identification used by antivirus software.

[12] Security Aspects
Chapter: [12] Security Aspects
Concept: undefined >> undefined

______ command is used to remove the primary key from a table in SQL.

[9] Structured Query Language (SQL)
Chapter: [9] Structured Query Language (SQL)
Concept: undefined >> undefined

Which of the following commands will delete the table from the MYSQL database?

[9] Structured Query Language (SQL)
Chapter: [9] Structured Query Language (SQL)
Concept: undefined >> undefined

______ is a non-key attribute, whose values are derived from the primary key of some other table.

[9] Structured Query Language (SQL)
Chapter: [9] Structured Query Language (SQL)
Concept: undefined >> undefined

To establish a connection between Python and SQL databases, connect() is used. Which of the following arguments may not necessarily be given while calling connect()?

[9] Structured Query Language (SQL)
Chapter: [9] Structured Query Language (SQL)
Concept: undefined >> undefined

Write the command to view all tables in a database.

[9] Structured Query Language (SQL)
Chapter: [9] Structured Query Language (SQL)
Concept: undefined >> undefined

The code given below reads the following record from the table named student and displays only those records that have marks greater than 75:

  • RollNo - integer
  • Name - string
  • Clas - integer
  • Marks - integer

Note the following to establish connectivity between Python and MYSQL:

  • Username is root.
  • The password is the tiger.
  • The table exists in an MYSQL database named school.

Write the following missing statements to complete the code:

Statement 1 - to form the cursor object
Statement 2 - to execute the query that extracts records of those students whose marks are greater than 75.
Statement 3 - to read the complete result of the query (records whose marks are greater than 75) into the object named data, from the table student in the database.

import mysql.connector as mysql
def sql_data():
       con1=mysql.connect(host="localhost",user="root",password="tiger", database="school")
       mycursor=_______________ #Statement 1
       print("Students with marks greater than 75 are :")
                  _________________________ #Statement 2
                 data=__________________ #Statement 3
                for i in data:
                   print(i)
                print()
[9] Structured Query Language (SQL)
Chapter: [9] Structured Query Language (SQL)
Concept: undefined >> undefined

Navdeep creates a table RESULT with a set of records to maintain the marks secured by students in Sem1, Sem2, Sem3, and their divisions. After the creation of the table, he entered data of 7 students in the table.

ROLL_NO SNAME SEM1 SEM2 SEM3 DIVISION
101 KARAN 366 410 402 I
102 NAMAN 300 350 325 I
103 ISHA 400 410 415 I
104 RENU 350 357 415 I
105 ARPIT 100 75 178 IV
106 SABINA 100 205 217 II
107 NEELAM 470 450 471 I

Based on the data given above answer the following questions:

  1. Identify the most appropriate column, which can be considered as the Primary key.
  2. If two columns are added and 2 rows are deleted from the table result, what will be the new degree and cardinality of the above table?
  3. Write the statements to:
    a. Insert the following record into the table
    Roll No - 108, Name - Aadit, Sem1- 470, Sem2 - 444, Sem3 - 475, Div - I.
    b. Increase the SEM2 marks of the students 3% whose name begins with ‘N’.
    OR
    Write the statements to:
    a. Delete the record of students securing IV division.
    b. Add a column REMARKS in the table with datatype as varchar with 50 characters.
[9] Structured Query Language (SQL)
Chapter: [9] Structured Query Language (SQL)
Concept: undefined >> undefined

Write the command to view all databases.

[9] Structured Query Language (SQL)
Chapter: [9] Structured Query Language (SQL)
Concept: undefined >> undefined
< prev  61 to 80 of 219  next > 
Advertisements
Advertisements
CBSE Arts (English Medium) Class 12 Question Bank Solutions
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Accountancy
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Business Studies
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Computer Science (Python)
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Economics
Question Bank Solutions for CBSE Arts (English Medium) Class 12 English Core
Question Bank Solutions for CBSE Arts (English Medium) Class 12 English Elective - NCERT
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Entrepreneurship
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Geography
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Hindi (Core)
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Hindi (Elective)
Question Bank Solutions for CBSE Arts (English Medium) Class 12 History
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Informatics Practices
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Mathematics
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Physical Education
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Political Science
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Psychology
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Sanskrit (Core)
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Sanskrit (Elective)
Question Bank Solutions for CBSE Arts (English Medium) Class 12 Sociology
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×