0% found this document useful (0 votes)
5 views

harsh chauhan 12c sql commands

Practical file 2024-2025
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

harsh chauhan 12c sql commands

Practical file 2024-2025
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

SQL commands

Question.1 How do you create a new database in SQL ?

Question .2 how can you delete an existing database?

Question .3 how do you select a specific database to use ?

Question.4 how can you list all database on the server ?

Question .5 how can you create a new table in SQL ?


Question .6 how do you delete a table in SQL ?

Question.7 how can you add a new column to an existing table ?

Question.8 how do you delete a column from a table ?

Question.9 how can you rename a column in SQL ?

Question.10 how can you rename a column in sql?

Question.11 how do you insert data into a table ?

Question.12 how can you insert data into specific columns of a


table ?

Question.13 how do you update existing data in a table?


Question.14 how do you delete data from a table ?

Question.15 how do you select all columns from a table?

Question.16 how do you select specific columns from a table?

Question.17 how do you calculate the total sum of a numeric


column using SUM()?

Question.18 How can you find the average value of a column


using AVG()?
Question.19 How do you count the number of rows in a table
or based on a specific condition using COUNT()?

Question.20 How can you find the maximum value in a


column using MAX()?

Question.21 How do you find the minimum value in a column


using MIN()?

Question.22 how can you combine aggregate functions with


group by to calculate totals for each other?

Question.23 how do you filter groups using having with


aggregate functions?
Question.24 how can you count the distinct values in a column
using count(distinct column_name?

Question.25 how do you use multiple aggregate function in a


single query(e.g sum(),max(),min()?

Question.26 how can you use aggregate functions on joined to


get results from multiple tables?

Question.27 how can you filter records based on a condition?


Question.28 How can you sort results in ascending or
descending order?
Descending

ascending

Question 29 how do you group record by a specific column?

Question 30 how can you use a having to filter groups in sql?


Question 31 how do you use a where clause with aggregate
functions?

Question 32 insert the details of a new teachers in the above


table?

Question 33 Delete the details of a teachers in the above


table?
Question 34 use the select command to get the details of
teachers with salary more then 70000?

Question 35Find the min, max, sum, and average of the


salary in a teacher salary table.

Question 36 Write a SQL query to order the (teachers ID,


salary) table in descending order of the salary?
Date Function

Question 37 How do you get the current date using


CURRENT_DATE or GETDATE()?

Question 38 How can you get the current time using


CURRENT_TIME or NOW()?

Question 39 How do you get the current date and time using
CURRENT_TIMESTAMP or NOW()?

Question 40 40 How can you extract the year from a date


using YEAR()?
Question 41 How do you extract the month from a date
using MONTH()?

Question 42 How can you extract the day from a date using
DAY() or DAYOFMONTH()?

Question 43 How can you find the day of the week for a
given date using DAYOFWEEK()
String function
Question 44 How do you convert text to uppercase using
UPPER()?

Question 45 How can you convert text to lowercase using


LOWER()?

Question 46 How do you get the length of a string using


LENGTH() or LEN()?

Question 47 How can you concatenate two strings using


CONCAT()?
Question 48 How can you remove spaces from the start and
end of a string using TRIM()?

Question 49 How do you extract a substring from a string


using SUBSTRING() or SUBSTR()?

Question 50 How do you extract a substring from a string


using SUBSTRING() or SUBSTR()?

Question 51
Math function

Question 52 How do you round a number to the nearest


integer using ROUND()?

Question 53 How can you round a number to a specified


decimal place using ROUND(number, decimals)?

Question 54 How do you find the absolute value of a number


using ABS()?

Question 55 How do you raise a number to a power using


POWER(base, exponent)?

Question 56 How can you calculate the remainder of a


division using MOD(dividend, divisor)?
Question 57 How can you calculate the square root of a
number using SQRT()?

Charts plotting question:


Question 58 given the school result data, analyses the
performance of the student on different parameters eg
subject wise or class wise?
&
For the DataFrame created above, analyze and plot
appropriate charts with title and legend ?
Question 51 Take data of your interest from an open source
(eg. Data.gov in) aggregate and summarize it then plot it
using different plotting functions of the matplotlib library.

Graph
Serial.no Name of program Page.no Teacher sign
01 Create

You might also like