Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Program2
CREATE TABLE student ( id INTEGER, first_name VARCHAR(20), last_name VARCHAR(20), age INTEGER, city VARCHAR(20), fees INTEGER ); INSERT INTO student(id, first_name, last_name, age, city, fees) VALUES(1, 'Vikas', 'Kumar', 18, 'Delhi', 2000); INSERT INTO student(id, first_name, last_name, age, city, fees) VALUES(2, 'Neha', 'Jain', 14, 'Alwar', 4500); INSERT INTO student(id, first_name, last_name, age, city, fees) VALUES(3, 'Girish', 'Sharma', 15, 'Delhi', 3000); SELECT * FROM STUDENT; SELECT COUNT(DISTINCT city) AS no_of_city FROM student; SELECT first_name FROM student WHERE fees > (SELECT AVG(fees) FROM student); SELECT * FROM student WHERE fees > (SELECT MIN(fees) FROM student) OR fees < (SELECT Max(fees) FROM student); SELECT AVG(age) AS avg_age FROM student; SELECT id, first_name, age FROM student WHERE age NOT BETWEEN 0 AND (SELECT AVG(age) FROM student); SELECT id, first_name, age FROM student WHERE age BETWEEN (SELECT AVG(age) FROM student) AND (SELECT MAX(age) FROM student); SELECT * FROM student WHERE age = (SELECT MAX(age) FROM student) AND fees = (SELECT MIN(fees) FROM student);
run
|
edit
|
history
|
help
0
FIGURA5.4
SQL Server NULL replacement with dynamic value
i need help
Create Tables_2
Lunes
Uzd
get date part from datetime
FIRST DATABASE
FIGURA5.4
ESTEFANIA