请教2个sql query 问题# Database - 数据库
c*n
1 楼
请教2个sql query 问题:
1. 假设有table A, and A has attribute k1, k2, k3, k4, k5
怎样判断{k1, k2, k3} 是否是一个candidate key? 也就是说是否{k1, k2, k3}
uniquely identify each row.
2. 假设有table A, and A has a numeric attribute "date". It stores
information like "200604", which means April in year 2006. Now I want to
derive a new table B, which contains two numerical attribute "Month" and "
year" from A. How to write the query?
也就是说从原来的 200604 变成 2006 和 4, 都是numeric attribute.
谢谢看完我的问题.
1. 假设有table A, and A has attribute k1, k2, k3, k4, k5
怎样判断{k1, k2, k3} 是否是一个candidate key? 也就是说是否{k1, k2, k3}
uniquely identify each row.
2. 假设有table A, and A has a numeric attribute "date". It stores
information like "200604", which means April in year 2006. Now I want to
derive a new table B, which contains two numerical attribute "Month" and "
year" from A. How to write the query?
也就是说从原来的 200604 变成 2006 和 4, 都是numeric attribute.
谢谢看完我的问题.