Creating a table
Create the tables and set the data schema for them using the statement CREATE TABLE.
Note
Keywords are case-insensitive and written in capital letters for clarity only.
1. CREATE TABLE series -- series is the table name.
2. ( -- Must be unique within the folder.
3. series_id Uint64,
4. title Utf8,
5. series_info Utf8,
6. release_date Uint64,
7. PRIMARY KEY (series_id) -- The primary key is a column or
8. -- combination of columns that uniquely identifies
9. -- each table row (contains only
10. -- non-repeating values). A table can have
11. -- only one primary key. For every table
12. -- in YDB, the primary key is required.
13. );
15. CREATE TABLE seasons
16. (
17. series_id Uint64,
18. season_id Uint64,
19. title Utf8,
20. first_aired Uint64,
21. last_aired Uint64,
22. PRIMARY KEY (series_id, season_id)
23. );
25. CREATE TABLE episodes
26. (
27. series_id Uint64,
28. season_id Uint64,
29. episode_id Uint64,
30. title Utf8,
31. air_date Uint64,
32. PRIMARY KEY (series_id, season_id, episode_id)
33. );
35. COMMIT;

