Page MenuHomeDevCentral

mysql.sql
No OneTemporary

mysql.sql

create database if not exists test_keruald_db;
use test_keruald_db;
drop table if exists numbers;
create table numbers
(
number_id bigint auto_increment primary key,
number int null
);
drop table if exists ships;
create table ships
(
id int auto_increment primary key,
name varchar(255) null,
category varchar(3) null
);
INSERT INTO `ships` VALUES
(1,'So Much For Subtlety','GSV'),
(2,'Unfortunate Conflict Of Evidence','GSV'),
(3,'Just Read The Instructions','GCU'),
(4,'Just Another Victim Of The Ambient Morality','GCU');
drop view if exists ships_count;
create view ships_count as
select `test_keruald_db`.`ships`.`category` AS `category`,
count(`test_keruald_db`.`ships`.`category`) AS `count(category)`
from `test_keruald_db`.`ships`
group by `test_keruald_db`.`ships`.`category`;

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 16, 12:54 (1 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3124082
Default Alt Text
mysql.sql (857 B)

Event Timeline