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

SQL Commands 12 File

Uploaded by

rihankhan844.786
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

SQL Commands 12 File

Uploaded by

rihankhan844.786
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 databases in sql?

Question.2 how can you delete an existing database?

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

Question 4how 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 7how can you add a new column to an existing


table ?

Question 8how 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 11how do you insert data into a table?


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

Question 13how 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 22how 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 employees in the


above table?
Question 33 Delete the details of a employee in the above
table?

Question 34 use the select command to get the details of


employee with salary more then 70000?

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


salary in a employee table.
Question 36 Write a SQL query to order the (name, 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 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()?

B part

Question 50
Math function

Question 51 How do you round a number to the nearest


integer using ROUND()?

Question 52 How can you round a number to a specified


decimal place using ROUND(number, decimals)?

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


using ABS()?
Question 54 How do you raise a number to a power using
POWER(base, exponent)?

Question 55 How can you calculate the remainder of a


division using MOD(dividend, divisor)?

Question 56 How can you calculate the square root of a


number using SQRT()?

Chart plotting question:


Question 57given 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

Output

Question 58
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

You might also like