Computer Science
Write the name of the functions to perform the following operations:
- To display the day like 'Monday', 'Tuesday', from the date when India got independence.
- To display the specified number of characters from a particular position of the given string.
- To display the name of the month in which you were born.
- To display your name in capital letters.
SQL Queries
1 Like
Answer
- DAYNAME("1947-08-15")
- SUBSTRING(string, pos, n)
- MONTHNAME("yyyy-mm-dd")
- UPPER('YourName')
Answered By
2 Likes
Related Questions
What do you understand by Cartesian Product?
Differentiate between the following statements:
(i) ALTER and UPDATE
(ii) DELETE and DROP
Write the output produced by the following SQL statements:
(a)
SELECT POW(2, 3);
(b)
SELECT ROUND(342.9234, -1);
(c)
SELECT LENGTH("Informatics Practices");
(d)
SELECT YEAR("1979/11/26"), MONTH("1979/11/26"), DAY("1979/11/26"), MONTHNAME("1979/11/26");
(e)
SELECT LEFT("INDIA", 3), RIGHT("ComputerScience", 4), MID("Informatics", 3, 4), SUBSTR("Practices", 3);
Consider the following MOVIE table and write the SQL queries based on it.
MovieID MovieName Category ReleaseDate ProductionCost BusinessCost 001 Hindi_Movie Musical 2018-04-23 124500 130000 002 Tamil_Movie Action 2016-05-17 112000 118000 003 English_Movie Horror 2017-08-06 245000 360000 004 Bengali_Movie Adventure 2017-01-04 72000 100000 005 Telugu_Movie Action - 100000 - 006 Punjabi_Movie Comedy - 30500 - (a) Display all the information from the Movie table.
(b) List business done by the movies showing only MovieID, MovieName and TotalEarning. TotalEarning to be calculated as the sum of ProductionCost and BusinessCost.
(c) List the different categories of movies.
(d) Find the net profit of each movie showing its MovieID, MovieName and NetProfit. Net Profit is to be calculated as the difference between Business Cost and Production Cost.
(e) List MovieID, MovieName and Cost for all movies with ProductionCost greater than 10,000 and less than 1,00,000.
(f) List details of all movies which fall in the category of comedy or action.
(g) List details of all movies which have not been released yet.