-- Database schema
| customer : c_custkey [ INTEGER ] primary_key , c_mktsegment [ TEXT ] , c_nationkey [ INTEGER ] customer.c_nationkey = nation.n_nationkey , c_name [ TEXT ] , c_address [ TEXT ] , c_phone [ TEXT ] , c_acctbal [ REAL ] , c_comment [ TEXT ] | lineitem : l_shipdate [ DATE ] , l_orderkey [ INTEGER ] lineitem.l_orderkey = orders.o_orderkey , l_discount [ REAL ] , l_extendedprice [ REAL ] , l_suppkey [ INTEGER ] lineitem.l_suppkey = partsupp.ps_suppkey , l_quantity [ INTEGER ] , l_returnflag [ TEXT ] , l_partkey [ INTEGER ] lineitem.l_partkey = partsupp.ps_partkey , l_linestatus [ TEXT ] , l_tax [ REAL ] , l_commitdate [ DATE ] , l_receiptdate [ DATE ] , l_shipmode [ TEXT ] , l_linenumber [ INTEGER ] , l_shipinstruct [ TEXT ] , l_comment [ TEXT ] | nation : n_nationkey [ INTEGER ] primary_key , n_name [ TEXT ] , n_regionkey [ INTEGER ] nation.n_regionkey = region.r_regionkey , n_comment [ TEXT ] | orders : o_orderdate [ DATE ] , o_orderkey [ INTEGER ] primary_key , o_custkey [ INTEGER ] orders.o_custkey = customer.c_custkey , o_orderpriority [ TEXT ] , o_shippriority [ INTEGER ] , o_clerk [ TEXT ] , o_orderstatus [ TEXT ] , o_totalprice [ REAL ] , o_comment [ TEXT ] | part : p_partkey [ INTEGER ] primary_key , p_type [ TEXT ] , p_size [ INTEGER ] , p_brand [ TEXT ] , p_name [ TEXT ] , p_container [ TEXT ] , p_mfgr [ TEXT ] , p_retailprice [ REAL ] , p_comment [ TEXT ] | partsupp : ps_partkey [ INTEGER ] partsupp.ps_partkey = part.p_partkey , ps_suppkey [ INTEGER ] partsupp.ps_suppkey = supplier.s_suppkey , ps_supplycost [ REAL ] , ps_availqty [ INTEGER ] , ps_comment [ TEXT ] | region : r_regionkey [ INTEGER ] primary_key , r_name [ TEXT ] , r_comment [ TEXT ] | supplier : s_suppkey [ INTEGER ] primary_key , s_nationkey [ INTEGER ] supplier.s_nationkey = nation.n_nationkey , s_comment [ TEXT ] , s_name [ TEXT ] , s_address [ TEXT ] , s_phone [ TEXT ] , s_acctbal [ REAL ] |
-- -- Of the orders with a lower delivery priority, how many have an urgent priority order?

SELECT COUNT(o_orderkey) FROM orders WHERE o_orderpriority = '1-URGENT' GROUP BY o_orderdate ORDER BY o_orderdate DESC LIMIT 1;