Sql course dec1

From Training Material
Jump to navigation Jump to search

Course Outline

mysql download

get mysql-x.x.xx-osx10.x-x86_32.pkg

sudo /Library/StartupItems/MySQLCOM/MySQLCOM start

alias mysql=/usr/local/mysql/bin/mysql

alias mysqladmin=/usr/local/mysql/bin/mysqladmin

go into system preferences, click mysql, start the server

type in mysql at the command line

reference manual

SQL Programming

SQL Cheat Sheet

xkcd tables

create table dept (deptno int(2), dname varchar(15), loc varchar(12));

insert into dept values (10, 'accounting', 'new york'), (20, 'research', 'london'), (30, 'sales', 'paris'), (40, 'operations', 'berlin');

select * from dept;

create table salgrade (grade int(1), losal int(4), hisal int(4));

insert into salgrade values (1, 700, 1200), (2, 1201, 1400), (3, 1401, 2000), (4, 2001, 3000), (5, 3001, 9999);

select * from salgrade;