NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

create database Employee;
use Employee;
show tables;
create table employees(
employeeid NUMERIC(9),
Firstname VARCHAR(10),
Lastname VARCHAR(20),
Deptcode CHAR(5),
Salary NUMERIC(9,2)
);
insert into employees values
(1,'Johanna','Ngo','ADMIN',30000.00),
(2,'Jason','Abalos','ACCNT',18000.00),
(4,'Michael','Santiago','SALES',15000.00),
(6,'Nazario','Santos',NULL,24000.00);
create table departments(
Code CHAR(5),
Name VARCHAR(30),
Managerid NUMERIC(9),
Subdeptof CHAR(5)
);
insert into departments values
('ADMIN','Administration',1,NULL),
('ACCNT','Accounting',2,'ADMIN'),
('SALES','Sales',3,'ADMIN'),
('MKTG','Marketing',4,'SALES');
create table projects(
Projected CHAR(8),
Deptcode CHAR(5),
description VARCHAR(200),
Startdate DATE,
Stopdate DATE,
Revenue NUMERIC(12,2)
);
insert into projects values
('EMPHAPPY','ADMIN','Employee Moral','2008-09-15',NULL, 0.00),
('ADT4MFIA','ACCNT','Mofia Audit','2008-07-03','2008-11-30',100000.00),
('ROBOSPSE','SALES','Robot','2008-03-14',NULL,242000.00),
('DNLCLNT','MKTG','Download Client','2008-02-03',NULL,18150.00);
create table workson(
employeeid NUMERIC(9),
Projected CHAR(8),
assignedtime DECIMAL(3,2)
);
insert into workson values
(2,'ADT4MFIA',0.50),
(3,'ROBOSPSE',0.75),
(4,'ROBOSPSE',0.75),
(5,'ROBOSPSE',0.50),
(5,'ADT4MFIA',0.6),
(3,'DNLDCLNT',0.25);

select * from employees;
select avg(Salary) from employees;
select min(Revenue) from projects
where Revenue>0;
select max(Revenue) from projects
where Revenue>0;
select count(Stopdate) from projects;
select employeeid,count(Projected)
from workson
group by employeeid;
select max(Lastname) from employees;
select count(Deptcode) from employees;
select count(employeeid), Deptcode
from employees
group by Deptcode;
select Deptcode, avg(Revenue), count(Projected)
from projects
group by Deptcode;
select Deptcode, avg(Revenue), count(Projected)
from projects
group by Deptcode
having count(Projected)>2;
select Deptcode, avg(Revenue), count(Projected)
from projects
where Stopdate is null
group by Deptcode
order by count(Projected) desc;
select employeeid
from workson
where assignedtime>1;
select salary*1.1,Deptcode
from employees
where not(Lastname like '%re')
group by Deptcode;


create table examples(
c integer
);

insert into examples values
(1),(2),(3),(null);

select * from examples;
select avg(c) from examples;
use mydb;
select avg(orderprice) from sales;
select sum(orderprice)/count(8) from sales;
select * from sales where orderprice> 100;


     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.